package com.macro.mall.commission.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 用户账户余额变更记录
 *
 * @author xuyanjun
 * @date 2019-12-11
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("commission_user_balance_change")
public class UserBalanceChangeEntity {

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 最后修改时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 变化金额
     */
    @TableField(value = "change_amount")
    private Integer changeAmount;

    /**
     * 变化后余额
     */
    @TableField(value = "after_change_balance")
    private Integer afterChangeBalance;

    /**
     * 变化类型枚举 0:NONE:无 5:COMMISSION_INCOME:佣金收入 100:WITHDRAWAL:提现
     *
     * @see com.macro.mall.entity.enums.commission.UserBalanceChangeChangeTypeEnum
     */
    @TableField(value = "change_type")
    private Integer changeType;

    /**
     * 变化原因
     */
    @TableField(value = "reason")
    private String reason;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

}